<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>computed计算属性</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <p>count:{{count}}</p>
        <input type="text" v-model="count">
        <p>获取count加10后的数据{{add()}}</p>
        <p>获取count加10后的数据{{add()}}</p>
        <p>获取count加10后的数据{{add1}}</p>
        <p>获取count加10后的数据{{add1}}</p>
    </div>
</body>
</html>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            count: 0
        },
        methods:{
            add(){
                console.log('add方法被调用')
                return parseInt(this.count)+10
            }
        },
        computed:{
            add1(){
                console.log('computed方法被调用')
                return parseInt(this.count)+10
            }
        }
    })
</script>